//-
  ztncui - ZeroTier network controller UI
  Copyright (C) 2017-2021  Key Networks (https://key-networks.com)
  Licensed under GPLv3 - see LICENSE for details.

extends users_layout

block users_content
  if message
    .row
      .col-sm-12
        .alert.alert-info
          strong= message

  form.form-horizontal(method='POST' action='')
    .form-group.row
      .col-sm-2
        label(for='username') 用户名:
      .col-sm-10
        .input-group
          span.input-group-addon
            i.glyphicon.glyphicon-user
          input#username.form-control(type='text' name='username' placeholder='输入用户名' value=user.name readonly=readonly)

    .form-group.row
      .col-sm-2
        label(for='password1') 输入新密码:
      .col-sm-10
        .input-group
          span.input-group-addon
            i.glyphicon.glyphicon-lock
          input#password1.form-control(type='password' name='password1' placeholder='输入新密码' value=(undefined===user.password1? '' : user.password1))

    .form-group.row
      .col-sm-2
        label(for='password2') 重新输入密码:
      .col-sm-10
        .input-group
          span.input-group-addon
            i.glyphicon.glyphicon-lock
          input#password2.form-control(type='password' name='password2' placeholder='重新输入密码' value=(undefined===user.password2? '' : user.password2))

    .form-group.row
      .col-sm-2
        label(for='pass_set') 下次登录时更改密码:
      .col-sm-10
        input#pass_set(type='checkbox' name='pass_set' value='check')

    .form-group.row
      .col-sm-2
      .col-sm-10
        button.btn.btn-primary(type='submit') 设置密码
        = ' '
        a.btn.btn-default(href='/users' name='cancel' role='button') 取消

  if errors
    .form-group.row
      .col-sm-12
        ul
          for err in errors
            li!= err.msg
